﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace LiHong.CSharpStudy.Lession1
{
    public class Fz
    {
        static void Main()
        {
            int year = 0;

            throw new Exception("我就是想出错");

            while (true)
            {
                try
                {
                    year = int.Parse(Console.ReadLine());
                    break;
                }
                catch (Exception ex)
                {
                    Console.WriteLine("你的输入有误。" + ex.Message);
                }
                finally
                {
                    Console.WriteLine("finally。");

                }
            }

            if (year % 400 == 0)
            {
                Console.WriteLine("是闰年");
            }
            else
            {
                if (year % 4 == 0)
                {
                    if (year % 100 == 0)
                    {
                        Console.WriteLine("不是闰年");
                    }
                    else
                    {
                        Console.WriteLine("是闰年");
                    }
                }
                else
                {
                    Console.WriteLine("不是闰年");
                }
            }

        }
    }
}
